package test00.lx05.t01;

import test00.lx04.t01.Student;

import java.util.Arrays;
import java.util.Comparator;
import java.util.function.Supplier;

/**
 * @author ZQX
 * @date 2025-04-07
 */
public class MainTest {
    public static void main(String[] args) {
        Student[] arrStudents = {
                new Student("张三",18) ,
                new Student("李四",8) ,
                new Student("王五",38) ,
                new Student("赵六",28) ,
                new Student("田七",7) ,
        } ;
        // T get();
        Supplier<Student> supplier = ()->{
            // int compare(T o1, T o2);
            Arrays.sort(arrStudents, Comparator.comparingInt(Student::getAge));
            return arrStudents[0] ;
        } ;

        Student minStudent = supplier.get();
        System.out.println(minStudent);
    }
}
